<?php

	if(isset($_GET['sid']))
	{
		$sid=intval($_GET['sid']);
		if($sid<=0)
		{
			edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
		}
	}
	else
	{
		edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));
	}
	
	$shopDAO = GetShopDAO();	
	$shopResult = $shopDAO->GetShopInfo($sid);
	if(!$shopResult)
	{	
		edp_redirect(edp_href_link(PAGENAME_PAGE_NOT_FOUND));	
	}
	else
	{    		
		$userip = getUserRealIPAddr();	 
		//更新view_count字段和view_history表
		$shopDAO->UpdateShopViewCount($sid);
		$shopDAO->UpdateShopViewHistory($userip,$sid); 
		
		$listDAO = GetListDAO();
		$productDAO = GetProductDAO();				
	}
?>
